
<div class="toolbox">
  <%= link_to "프로그램 추가", new_admin_channel_program_path(@channel) %>

  <ul class="filter clearfix">
    <li><%= link_to "일요일", admin_channel_programs_path(:day_of_week => "sunday") %></li>
    <li><%= link_to "월요일", admin_channel_programs_path(:day_of_week => "monday") %></li>
    <li><%= link_to "화요일", admin_channel_programs_path(:day_of_week => "tuesday") %></li>
    <li><%= link_to "수요일", admin_channel_programs_path(:day_of_week => "wednesday") %></li>
    <li><%= link_to "목요일", admin_channel_programs_path(:day_of_week => "thursday") %></li>
    <li><%= link_to "금요일", admin_channel_programs_path(:day_of_week => "friday") %></li>
    <li><%= link_to "토요일", admin_channel_programs_path(:day_of_week => "saturday") %></li>
  </ul>
</div>

<table class="programs">
  <thead>
    <tr>
      <th class="channel">채널</th>
      <th class="day_of_week">요일</th>
      <th class="time">시간</th>
      <th class="title">프로그램명</th>
      <th class="pd_name">PD</th>
      <th class="operator_name">진행자</th>
      <th class="logo_position">로고위치</th>
      <th class="logo_url">로고</th>
      <th class="background_url">배경이미지</th>
      <th class="actions"></th>
    </tr>
  </thead>
  <tbody>
    <% @programs.each do |program| %>
      <tr class="<%= cycle("odd", "even") %>">
        <td class="channel"><%= program.channel.name %></td>
        <td class="day_of_week"><%= program.day_of_week %></td>
        <td class="time">
          <%= program.start_time %>
          ~
          <%= program.end_time %>
        </td>
        <td class="title"><%= program.title %></td>
        <td class="pd_name"><%= program.pd_name %></td>
        <td class="operator_name"><%= program.operator_name %></td>
        <td class="logo_position"><%= program.logo_position %></td>
        <td class="logo_url"><%= display_logo_image(program.logo_url) %></td>
        <td class="background_url"><%= display_background_image(program.background_url) %></td>
        <td class="actions">
          <%= link_to "수정", edit_admin_channel_program_path(@channel, program) %>
          <%= link_to "삭제", [:admin, @channel, program], :method => :delete, :confirm => "sure?" %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>

